# $Id$
# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=perl-dbi
pkgver=1.637
pkgrel=3
pkgdesc="Database independent interface for Perl"
arch=('i686' 'x86_64')
url="http://search.cpan.org/dist/DBI/"
license=('GPL' 'PerlArtistic')
depends=('perl')
checkdepends=('perl-test-pod' 'perl-test-pod-coverage')
options=('!emptydirs')
source=(http://www.cpan.org/authors/id/T/TI/TIMB/DBI-$pkgver.tar.gz)
sha512sums=('48002d77d40c40f0514d464a83f78255dc1a4c5ebb721fc18bcffa06d5f19ad7aec51084d5d8a032e37c6867b5f63176a9b11b5bdf08426f903b841139698240')

build() {
  cd DBI-$pkgver
  perl Makefile.PL INSTALLDIRS=vendor
  make
}

check() {
  cd DBI-$pkgver
  make test
}

package() {
  cd DBI-$pkgver
  make DESTDIR="$pkgdir" install
# template start; name=perl-binary-module-dependency; version=1;
if [[ $(find "$pkgdir/usr/lib/perl5/" -name "*.so") ]]; then
	_perlver_min=$(perl -e '$v = $^V->{version}; print $v->[0].".".($v->[1]);')
	_perlver_max=$(perl -e '$v = $^V->{version}; print $v->[0].".".($v->[1]+1);')
	depends+=("perl>=$_perlver_min" "perl<$_perlver_max")
fi
# template end;
}
